package com.astrofizzbizz.stoneedgegui.app;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class WaitFrame extends JFrame
{
	private static final long serialVersionUID = -7926760418288495567L;

	public WaitFrame(String title, String infoMessage, JFrame parent)
	{
		super(title);
		ClassLoader loader = Thread.currentThread().getContextClassLoader();
		ImageIcon logoIcon = new ImageIcon(loader.getResource("com/astrofizzbizz/stoneedgegui/files/StoneEdgeTelescopeLogo.jpg"));
		setIconImage(logoIcon.getImage());

		JPanel infoPanel = new JPanel();
		infoPanel.setLayout(new BoxLayout(infoPanel, BoxLayout.X_AXIS));
		infoPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""),BorderFactory.createEmptyBorder(5,5,5,5)));
		JLabel warningLabel = new JLabel();
		warningLabel.setIcon(new ImageIcon(loader.getResource("com/astrofizzbizz/stoneedgegui/files/warning.jpg")));
		infoPanel.add(warningLabel);
		infoPanel.add(new JLabel("\n" + infoMessage + "\n"));
		getContentPane().add(infoPanel);
		setVisible(true);
		pack();
		setLocationRelativeTo(parent);
		paint(getGraphics());
	}

}
